-------------------------------------------------------------------------------
-- RTSAI - Real-Time Strategy engine for AI research
-- Copyright(C) 2006 DIMAp-UFRN, licensed under LGPL
--
-- RTSAI civilization example
-------------------------------------------------------------------------------
--[[
The civilization file specifies a group of the classes of units connected
between themselves. They are interdependents since for creating a unit from
a class we need to use a unit from another class.

The classes describe commom attributes for the units who are member of. The
attributes defined here must be *read-only*. Applications may describe their
own attributes, however there are someones that whether the application does
not define, RTSAI will provide a default value.
The following example presents the commom attribute and their default values.

UnitClass {
    name,                -- it's a obligatory field. There is no default value.
    attack_power = 10,   -- how strong is an attack from units of this class
    attack_range = 10,   -- how close the unit must be to attack
    creation_delay = 10, -- how long it take to create an unit from this class
    max_life = 100,      -- the max value of points of life
    area = circ(5),      -- the bounding area surrounding the unit
    construct = {}       -- the class of unit that it can create
    resources = {}       -- which resources is needed to create a unit
}

There are some attributes that may not be set. They are:
 - max_velocity  -- when set, the unit is mobile and it defines its velocity
             -- when not set, this means that it's a fixed unit
 - parent    -- when set, the unit inherits the attributes from its parent
             -- when not set, there is no inheritance
--]]

-------------------------------------------------------------------------------

-- 'civilization' is obligatory variable that must be set at the beginning of
-- the file. Actually, all unit class created from now will be part of this
-- civilization.
civilization = "poti"

-- Base of the player. This is a fixed unit, which is usually referred as
-- "center-city".
UnitClass {
    name = "base",
    attack_power = 150,
    attack_range = 30,
    creation_delay = 100,
    fog_of_war = 25,
    max_life = 100,
    area = rect(10,10),
    construct = {"worker"},
    resources = {wood = 500, food = 200}
}

-- Mobile unit responsible for constructing fixed units.
UnitClass {
    name = "worker",
    max_velocity = 10,
    construct = {"base", "training_field"},
    resources = {food = 50}
}

-- Mobile unit responsible for the attack force.
UnitClass {
    name = "warrior",
    parent = "worker",
    attack_power = 50,
    attack_range = 20,
    max_life = 15,
    resources = {metal = 25, food = 50}
}

-- Unit responsible for the warrior creation.
UnitClass {
    name = "training_field",
    parent = "base",
    construct = {"warrior"},
    resources = {metal = 150, wood = 150}
}

